<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/12/9 0009
  Time: 16:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>新增</title>
    <script src="js/jquery-3.4.1.min.js"></script>
    <script>
        $(function () {
            //js/grade.json
            $.getJSON("gradeJsonServlet",function(data){
                var g=$("#gradeid");
                $.each(data,function (i,d) {
                   g.append(new Option(d.gname,d.id));//<optioa
                });
            });
        });
    </script>
    <script>
        //$.post("add",{sname:xx,sex:'nan'});
    </script>
</head>
<body>
<form name="from1" method="post" enctype="multipart/form-data" action="doAddStudent.jsp" style="width: 250px;margin:  0 auto">
    <h1>添加学生</h1>
    <table border="0">
        <tr>
            <td>姓名:</td>
            <td><input type="text" name="username" required /></td>
        </tr>
        <tr>
            <td>密码:</td>
            <td><input type=" password" name="password" required pattern="\w{5,10}"/>
            </td>
        </tr>
        <tr>
            <td>电话:</td>
            <td><input type="text" name="tel" required/></td>
        </tr>
        <tr>
            <td>QQ:</td>
            <td><input type="text" name="qq" required/></td>
        </tr>
        <tr>
            <td>微信:</td>
            <td><input type="text" name="wechat" required/></td>
        </tr>
        <tr>
            <td>性别:</td>
            <td>
                <input type="radio" name="gender" value="男"/>男
                <input type="radio" name="gender" value="女"/>女
            </td>
        </tr>
        <tr>
            <td>入学日期:</td>
            <td><input type="date" name="enterdate" /></td>
        </tr>
        <tr>
            <td>生日:</td>
            <td><input type="date" name="birthday" /></td>
        </tr>
        <tr>
            <td>班级:</td>
            <td>
                <select name="gradeid" id="gradeid"></select>
            </td>
        </tr>
        <tr>
            <td>籍贯:</td>
            <td><input type="text" name="fromcity" /></td>
        </tr>
        <tr>
            <td>现居住:</td>
            <td><input type="text" name="address" /></td>
        </tr>
        <tr>
            <td>身份证照片正面:</td>
            <td><input type="file" name="idcardpic" /></td>
        </tr>
    </table>
    <input type="submit" name="提交">
    <a href="index.jsp" style="margin-left: 20px;text-decoration: none;color: black">返回上一级</a>
</form>

</body>
</html>
